<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<meta charset="utf-8">
<TITLE>
The plug-in class
</TITLE>

<link rel="stylesheet" type="text/css" HREF="../book.css">
</HEAD>
<BODY>
<H2>
The plug-in class</H2>
<P >
So far, we've been looking at the different extensions that are provided by the contributions plug-in. Let's look at the general 
definition of the contributions plug-in.</P>

<H3>
Plug-in definition</H3>
<P >
The readme tool plug-in is defined in the <b>MANIFEST.MF</b> file.</P>
<pre>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %contributions.Activator.name
Bundle-SymbolicName: org.eclipse.ui.examples.contributions; singleton:=true
Bundle-Version: 3.3.100.qualifier
Bundle-Activator: org.eclipse.ui.examples.contributions.Activator
Require-Bundle: org.eclipse.ui;bundle-version="[3.3.0,4.0.0)",
 org.eclipse.core.runtime,
 org.eclipse.core.expressions;bundle-version="[3.3.0,4.0.0)"
Bundle-Vendor: %contributions.Activator.providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ActivationPolicy: lazy
</pre>
<P >
The plug-in definition includes the <b>Bundle-Name</b>, <b>Bundle-SymbolicName</b> (plug-in id),
<b>Bundle-Version</b>, and <b>Bundle-Vendor</b> of the plug-in. We 
saw most of these parameters before in our hello world plug-in. The contribution plug-in
also defines a specialized plug-in class,
<b>org.eclipse.ui.examples.contributions.Activator</b>. </P>
<P >
The <b>Require-Bundle</b> element informs the platform of the contribution plug-in's dependencies. 
The workbench UI plug-ins are listed as required plug-ins, along with the various core and expression plug-ins.  </P>

<H3>
AbstractUIPlugin</H3>
<P >
The<b> Activator</b> class represents the contribution plug-in 
and manages the life cycle of the plug-in.&nbsp; As we saw in the
Hello World example, you don't have to specify a plug-in class.&nbsp; The
platform will provide one for you.&nbsp; In this case, our plug-in needs to
initialize UI related data when it starts up.&nbsp; 
The platform class <a href="../reference/api/org/eclipse/ui/plugin/AbstractUIPlugin.html"><b>AbstractUIPlugin</b></a>
provides a structure for managing UI resources and is extended by <b>
Activator</b>.</P>
<P >
<a href="../reference/api/org/eclipse/ui/plugin/AbstractUIPlugin.html"><b>AbstractUIPlugin</b></a>
 uses the generic startup and shutdown methods to manage images, dialog settings, and a preference store during the lifetime of the plug-in.&nbsp;
</P>



</BODY>
</HTML>
